package com.demo.common.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 聊天室成员表(ChatRoomMember)
 *
 * @author why
 * @since 2025-09-23 10:12:43
 */
@Data
@TableName("chat_room_member")
public class ChatRoomMember implements Serializable {

    private static final long serialVersionUID = 528999639763397965L;

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 房间ID
     **/
    private Long roomId;

    /**
     * 用户ID
     **/
    private Long userId;

    /**
     * 角色：OWNER-群主，ADMIN-管理员，MEMBER-成员
     **/
    private String role;

    /**
     * 群昵称
     **/
    private String nickname;

    /**
     * 加入时间
     **/
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date joinTime;

    /**
     * 是否被禁言
     **/
    private Integer isMuted;

    /**
     * 禁言到期时间
     **/
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date muteUntil;

    /**
     * 是否在群中
     **/
    private Integer isActive;
}



